<?php
namespace app\admin\controller;

use app\common\models\ArticleCategory;

/**
 * @name 留言管理
 * @desc 留言管理
 * @auth true
 * @author: xujianping(814876569@qq.com)
 * @datetime: 2017/9/18 上午 10:37
 */
class MessageBoard extends Common
{
    /**
     * index
     * @author: xujianping(814876569@qq.com)
     * @return mixed
     */
    public function index(){
        $model = new \app\common\models\MessageBoard();
        $list = $model->getPageData();

        return view('',['list'=>$list]);
    }

    /**
     *
     */
    public function remark(){
        $id = $this->request->post('id',0);
        $remark = $this->request->post('remark','');
        $model = new \app\common\models\MessageBoard();
        $d = $model->remark($id,$remark);
        if ($d){
            $this->success('操作成功');
        }else{
            $this->error('操作失败');
        }
    }

    /**
     * 删除
     */
    public function delete(){
        $id = $this->request->post('id',0);
        $model = new \app\common\models\MessageBoard();
        $d = $model->deleteDataById($id);
        if ($d){
            $this->success('删除成功');
        }else{
            $this->error('删除失败');
        }
    }
}